package com.terranovita.gaming.pulpgui;

import pulpcore.CoreSystem;
import pulpcore.Stage;

import com.terranovita.gaming.pulpgui.exceptionscene.UncaughtExceptionScene;
import com.terranovita.gaming.pulpgui.testscene.TestScene;

/**
 * The Class LoadingScene.
 */
public class LoadingScene extends pulpcore.scene.LoadingScene {
    
    /**
	 * Instantiates a new loading scene.
	 */
    public LoadingScene() {
        super(ProjectBuild.NAME + "-" + ProjectBuild.VERSION + ".zip" , new TestScene());
        
        CoreSystem.setTalkBackField("app.name", ProjectBuild.NAME);
        CoreSystem.setTalkBackField("app.version", ProjectBuild.VERSION);
        
        Stage.setUncaughtExceptionScene(new UncaughtExceptionScene());
        Stage.invokeOnShutdown(new Runnable() {
            public void run() {
                // Shutdown network connections, DB connections, etc. 
            }
        });
    }
    
    /* (non-Javadoc)
     * @see pulpcore.scene.LoadingScene#load()
     */
    @Override
    public void load() {
        
        // Start loading the zip
        super.load();
    }
}
